package com.ny.demo.demo516;

public class Emp {
   //(工号 姓名 年龄）
   private  String  number;
    private  String  name;
    private  int age;
//无法构造方法，用于创建空的员工对象
    public Emp(String number, String name, int age) {
        this.number = number;
        this.name = name;
        this.age = age;
    }

    public Emp() {

    }

    //set get 方法
    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    //当输出对象名的时候，可以直接获取到所有的属性
    @Override
    public String  toString(){
        return  "Emp{"+
                "number='" +number +'\'' +
                ",name='" +name +'\'' +
                ",age='" +age +
                '}';

    }
}
